<template>
	<view class="content">
		
		<view class="mix-list-cell" :class="border" @click="eventClick" hover-class="cell-hover"  :hover-stay-time="50">
			<view v-if="icon" class="cell-icon yticon">
				<u-icon
					:color="iconColor"
					:size="iconSize"
					:name="icon"
				></u-icon>
			</view>
			<text class="cell-tit clamp">{{title}}</text>
			<text v-if="tips" class="cell-tip">{{tips}}</text>
			<view v-if="icon||link" class="cell-more yticon">
				<u-icon
					color="#606266"
					size="28rpx"
					:name="typeList[navigateType]"
				></u-icon>
			</view>
		</view>

	</view>
</template>
 
<script>
	/**
	 *  简单封装了下， 应用范围比较狭窄，可以在此基础上进行扩展使用
	 *  比如加入image， iconSize可控等
	 */
	export default {
		data() {
			return {
				typeList: {
					left: 'arrow-left',
					right: 'arrow-right',
					up: 'arrow-up',
					down: 'arrow-down'
				},
			}
		},
		props: {
			icon: {
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: '标题'
			},
			tips: {
				type: String,
				default: ''
			},
			navigateType: {
				type: String,
				default: 'right'
			},
			border: {
				type: String,
				default: 'b-b'
			},
			hoverClass: {
				type: String,
				default: 'cell-hover'
			},
			iconColor: {
				type: String,
				default: '#333'
			},
			iconSize: {
				type: String,
				default: '18'
			},
			link:{
				type:Boolean,
				default:true
			}
		},
		methods: {
			eventClick(){
				this.$emit('eventClick');
			}
		},
	}
</script>

<style lang='scss'>

	.icon .mix-list-cell.b-b:after{
		left: 90upx;
	}
	.mix-list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx 32rpx;
		line-height:60upx;
		position:relative;
		
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}

		.cell-icon{
			align-self:center;
			width:72upx;
			max-height:72upx;
			font-size:38upx;
		}
		.cell-more{
			align-self: center;
			align-items: center;
			font-size:30upx;
			color:#606266;
			margin-left:$uni-spacing-row-sm;
		}
		.cell-tit{
			flex: 1;
			font-size: 28upx;
			color: #333;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: 26upx;
			color: #909399;
		}
	}
</style>
